import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// element-plus 依赖
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    // 在这里配置多个地址
    host: ['localhost', '10.136.160.125'], // 设置多个 host
    port: 8888, // 设置统一的端口号
  },
  plugins: [
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    })
  ],
    resolve: {
      alias: {
        // 设置@符号代表src目录
        '@': path.resolve(__dirname, 'src'),
      },
    },
})
